package com.xunfang.portal.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunfang.portal.model.entity.Book;
import com.xunfang.portal.model.entity.BookCollection;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author scott
* @description 针对表【t_book_collection】的数据库操作Service
* @createDate 2025-10-24 09:14:26
*/
public interface BookCollectionService extends IService<BookCollection> {

    /**
     *  收藏书籍
     * @param bookId
     * @param userId
     */
    public void addToFavorites(Long bookId, String userId);

    /**
     *  判断书籍是否收藏
     * @param bookId
     * @param userId
     * @return
     */
    Boolean checkFavorite(Long bookId, String userId);

    /**
     * 移除收藏
     * @param bookId
     * @param userId
     */
    void removeToFavorite(Long bookId, String userId);

    /**
     * 查询 收藏的书籍
     * @param userId
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<Book> getMyFavorites(String userId, Integer pageNum, Integer pageSize);
}
